import { createRouter, createWebHashHistory } from "vue-router";

import Home from "../pages/Home.vue";
import main from "../pages/main.vue";

const routes = [
    {
        path: "/",
        component: main,
        meta: {
            title: 'Vue3模型'
        }
    },
    {
        path: "/Home",
        component: Home,
        meta: {
            title: 'home'
        }
    },
]

const router = createRouter({
    history: createWebHashHistory(process.env.BASS_URL),
    routes
})

router.beforeEach((to, from, next) => {
    document.title = to.meta.title
    next()
})

export default router;
